Public Class frmNewEditGrouping
    Private Sub radStatic_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radStatic.CheckedChanged
        radDynamic.Checked = Not radStatic.Checked
    End Sub

    Private Sub radDynamic_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radDynamic.CheckedChanged
        radStatic.Checked = Not radDynamic.Checked
    End Sub

    Private Sub AddClientToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddClientToolStripMenuItem.Click
        Dim clients() As String
        Dim clientDetails() As String
        Dim i As Integer
        Dim newIndex As Integer

        frmListClients.ShowDialog()
        clients = Split(frmListClients.selectedClients, ",")

        For i = 0 To clients.Length - 1
            clientDetails = frmMain.net.adminGetClientDetails(clients(i))
            newIndex = gridStatic.Rows.Add()
            gridStatic.Rows(newIndex).Cells(0).Value = clientDetails(0)
            gridStatic.Rows(newIndex).Cells(1).Value = clientDetails(10)
            gridStatic.Rows(newIndex).Cells(2).Value = clientDetails(1)
            gridStatic.Rows(newIndex).Cells(3).Value = clientDetails(11)
            gridStatic.Rows(newIndex).Tag = clients(i)
        Next
    End Sub

    Private Sub cmnStaticMembers_Opening(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles cmnStaticMembers.Opening
        If gridStatic.SelectedRows.Count > 0 Then
            RemoveClientToolStripMenuItem.Enabled = True
        Else
            RemoveClientToolStripMenuItem.Enabled = False
        End If
    End Sub

    Private Sub RemoveClientToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RemoveClientToolStripMenuItem.Click
        Dim i As Integer

        For i = gridStatic.SelectedRows.Count - 1 To 0 Step -1
            gridStatic.Rows.RemoveAt(gridStatic.SelectedRows(i).Index)
        Next
    End Sub
End Class